import Cookies from 'js-cookie'

const TokenKey = 'HR-Token'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(value, attrs) {
  return Cookies.set(TokenKey, value, attrs)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}

export function deleteAllCookies() {
  var cookies = Cookies.get()
  Object.keys(cookies).forEach(item => {
    Cookies.remove(item, {})
  })
}
